import Header from '@/components/Header'
import { ContainerBody, RightContainer, WrapStyle } from './style'
import Routers from '@/router'
import { AppContext } from './context'
import useAppHook from './AppServer'
import MenuView from './AppMenu'
window.MoSource = 'sac'
const App = () => {
	const { ...useHook } = useAppHook()
	return (
		<AppContext.Provider
			value={{
				user: useHook.user,
				system: useHook.system,
				reLoadUser: useHook.reLoadUser,
				reLoadSystem: useHook.reLoadSystem,
			}}
		>
			<Header></Header>
			<ContainerBody className={`containerBody ${useHook.isShowMenu ? '' : 'hiddenMenu'}`}>
				{useHook.isShowMenu && (
					<WrapStyle>
						<MenuView pathname={useHook.pathname}></MenuView>
					</WrapStyle>
				)}
				<RightContainer className="rightContainer">
					<Routers></Routers>
				</RightContainer>
			</ContainerBody>
		</AppContext.Provider>
	)
}
export default App
